package mango.server.database;

import java.util.*;

public class User {

	private String username, password;
	private LinkedList playerList;
	private boolean validated = false;

	public User(String un, String pw) {
		username = un;
		password = pw;
	}

	public String getUsername() {
		return username;
	}
	
	public void addPlayer (Player p) {
		if (validated) {
			playerList.add(p);
		}
	}

	public boolean validate (String attempt) {
		if (attempt.equals(password)) {
			validated = true;
			return true;
		}
		else
			return false;
	}

	public boolean setPassword(String oldpass, String newpass) {
		if (oldpass.equals(password)) {
			password = newpass;
			return true;
		} else {
			return false;
		}
	}
}
